import request from '@/utils/request'
// 业务类型 API接口
const std_biztypeApi = {
    list: '/std_biztype/list',
    save: '/std_biztype/save',
    view: '/std_biztype/view',
    del: '/std_biztype/delete',
    dels: '/std_biztype/batchDel',
    output: '/std_biztype/output',
    exportExcelTemplate: '/std_biztype/exportExcelTemplate',
    importExcel: '/std_biztype/importExcel',
    tree: '/std_biztype/tree',
    deleted: '/std_biztype/deleted',
    deleteds: '/std_biztype/deleteds',
}

/**
 * 导入业务类型Excel
 */
export function importExcel(data) {
  var body = new FormData()
  body.append("file", data);
  return request({
    url: std_biztypeApi.importExcel,
    headers: {"Content-Type": "multipart/form-data"},
    method: 'post',
    data: body
  })
}

/**
 * 导出业务类型Excel模板
 */
export function exportExcelTemplate () {
    return request({
        url: std_biztypeApi.exportExcelTemplate,
        method: 'post',
        responseType: 'blob'
    })
}

/**
 * 导出业务类型
 */
export function output (data) {
    return request({
        url: std_biztypeApi.output,
        method: 'post',
        data: data ,
        responseType: 'blob'
    })
}
/**
 * 批量删除业务类型
 * @param {*} ids
 */
export function delStd_biztypes (ids) {
    return request({
        url: std_biztypeApi.dels,
        method: 'post',
        params: {ids}
    })
}
/**
 * 删除业务类型
 * @param {*} id
 */
export function delStd_biztype (id) {
    return request({
        url: std_biztypeApi.del,
        method: 'post',
        params: {id}
    })
}
/**
 * 逻辑删除业务类型
 * 
 */
 export function deletedStd_biztype (id) {
    return request({
        url: std_biztypeApi.deleted,
        method: 'post',
        params: {id}
    })
}
/**
 * 批量逻辑删除业务类型
 * @param {*} ids
 */
 export function delStd_biztypeByIds (ids) {
    return request({
        url: std_biztypeApi.deleteds,
        method: 'post',
        params: {ids}
    })
}
/**
 * 查看、编辑业务类型
 * @param {*} id
 */
export function viewStd_biztype (id) {
    return request({
        url: std_biztypeApi.view,
        method: 'get',
        params: {id}
    })
}
/**
 * 保存业务类型
 * @param {*} body
 */
export function saveStd_biztype (body) {
    return request({
        url: std_biztypeApi.save,
        method: 'post',
        data: body
    })
}
/**
 * 查询业务类型列表
 * @param {*} body
 */
export function queryStd_biztypeList (body) {
    return request({
        url: std_biztypeApi.list,
        method: 'post',
        data: body
    })
}

/**
 *业务类型树
 * @returns
 */
export function tree () {
    return request({
        url: std_biztypeApi.tree,
        method: 'post'
    })
}
